package com.Ajava1704.for定时线程池的使用;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @类名: com.Ajava1704.for定时线程池的使用
 * @作者: lgt
 * @创建时间: 2020-02-11 20:20
 * @描述:
 **/
public class ForConnectionUtils {
    private static ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);

    public static void forConnectionTry(){

        ForConnRunable forConnRunable = new ForConnRunable(scheduledExecutorService);
        scheduledExecutorService.scheduleWithFixedDelay(forConnRunable,0,3, TimeUnit.SECONDS);
    }

}
